Repository navigation
fix(governance): hold data product port changes for approval, keep approvals off their requester, fix the port picker and status rule display - #35740
Conversation
Adding or removing an input or output port wrote the relationship at once, so an Enforce approval workflow on data products never held it. Ports are relationships, not fields of the data product, so the gate could not see them. The gate now judges a data product with its ports as the list fields inputPorts and outputPorts, which are already trigger fields for data products. A port change by a person is held as a change request reviewed by the data product's workflow and written when it is approved; bots write through. A held field change and a held port change on the same data product form one request.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
…he admins When the only person an approval could ask was the requester, a workflow running after the edit gave the task back to the requester even when its empty-assignee strategy was assignAdmins, so the requester could approve their own change. The requester is now kept only under the none strategy; assignAdmins routes the approval to the other admins, and wait leaves it unassigned.
The input and output port picker searches the data asset index, which also holds table columns, so a column could be picked and the server then refused it as a port. The picker now excludes columns, matching what the server accepts as a port.
❌ UI Checkstyle Failed❌ Bundle Runtime CheckA route chunk loads but one of its chunks still exports 🔍 ESLint findings in this PR's files — 0 error(s), 15 warning(s)Errors block the build. Warnings do not yet — they are rules whose backlog is still 0 error(s), 15 warning(s) across 5 changed file(s).
All findings
Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
…eted assets A held request adding the same asset as an input and an output port passed the checks, because each addition was checked only against the ports as published. Approval now checks each addition against the published ports and the other additions of the request, and refuses an asset that no longer exists, so neither can be written. Splits the port helpers into smaller methods, marks unchanged locals final, names repeated test strings, and records the decision that a data product port change is held as a list field of the data product, gated only by the data product's workflow.
A lifecycle playbook's "Check starting stage" rule tests whether an entity has no stage yet (entityStatus == null). The Status field offered only Is / Is Not, so the workflow canvas could not show the rule's operator and displayed the Operator placeholder beside "No value needed". - Offer Is Not Set / Is Set on the Status field. - Keep the Operator column wide enough to read its label in narrow panels, as the Field column already is.
anuj-kumary
left a comment
There was a problem hiding this comment.
Reviewed the UI changes. No regressions found: the touched jest suites pass (81 suites, 1178 tests), eslint shows 0 errors and tsc shows no new errors. A few small follow-ups are inline.
|
|
||
| const taskDisplayMessage = useMemo(() => { | ||
| const taskTypeLabel = t(TASK_ENTITY_TYPES[task.type] ?? 'label.task'); | ||
| const taskTypeLabel = t(getTaskTypeMessageKey(task) ?? 'label.task'); |
There was a problem hiding this comment.
getTaskTypeMessageKey(task) now reads task.payload, but this memo's deps (L640) still list only task.type, as does the header memo using it at L716 (deps ~L731). This adds two new react-hooks/exhaustive-deps warnings that main doesn't have. TaskFeedCardFromTask already got this fix (task.type → task); could both memos here get the same?
There was a problem hiding this comment.
Done in 3c389fb: both memos now depend on task (the title memo and the header memo), so the two new exhaustive-deps warnings are gone.
| size="text-xs" | ||
| weight="medium"> | ||
| {revision.requestedBy | ||
| ? `${t('label.comment')} · ${t('label.requested-by')}: ${ |
There was a problem hiding this comment.
This header joins translated strings by concatenation (Comment · Requested By: <name>), so word order is fixed in English. That breaks in RTL locales (ar-sa, he-he, pr-pr). It also shows the raw username, not a display name. The inbox panel (taskDetail.utils) shows the same data as two separate rows. Could this match that, or use one translation key with interpolation? Rendering the requester with UserPopOverCard / getEntityName would also show a proper name.
There was a problem hiding this comment.
Done in 3c389fb: the note now has a "Comment" row and, as its own row, "Requested by" with the reviewer through UserPopOverCard, display name resolved with useUserProfile + getEntityName (falls back to the username). No more concatenated label, so word order follows each locale. Checked on a local server: it reads "Requested By · Karan" with the profile card.
| onChange={setTaskAssignees} | ||
| /> | ||
|
|
||
| {taskAssignees === TaskAssignees.Candidates && ( |
There was a problem hiding this comment.
AssigneeSection hides the radio group for revision === resubmit, but this candidates picker and the Save-disabled check (L312) still depend only on taskAssignees === Candidates. If a resubmit node arrives with taskAssignees: candidates, one of two things happens: with an empty list, Save is disabled and the reason isn't visible; otherwise a picker appears for a step that asks nobody. Could both also require config.revision !== Revision.Resubmit?
There was a problem hiding this comment.
Done in 3c389fb: a module-level asksCandidates(config, taskAssignees) (false for a resubmit step) gates the picker, the Save-disabled check and the saved candidates. Test: a resubmit node stored with taskAssignees: candidates shows no picker and saves with candidates: [].
| }; | ||
|
|
||
| // A port names a data asset. Columns share the data asset search index but cannot be ports. | ||
| const PORT_ASSETS_FILTER: QueryFilterInterface = { |
There was a problem hiding this comment.
Minor/cosmetic: this filter covers the result list, but the port pickers' quick-filter Type dropdown (DOMAIN_DATAPRODUCT_DROPDOWN_ITEMS includes entityType) loads its options through ExploreQuickFilters → getAggregationOptions on SearchIndex.ALL without it. So "Table Column" can still be offered there, and picking it gives an empty list. Maybe pass the same exclusion into the quick-filter aggregation as well?
There was a problem hiding this comment.
Done in 3c389fb: the hook returns its port filter as assetsFilter, and the picker passes it to ExploreQuickFilters as defaultQueryFilter, which the option aggregation already merges. Checked on a local server: the Entity types filter of Add Input Ports lists metric, dataProduct, tag, glossaryTerm, table, database, databaseSchema, and no tableColumn.
- The revision note shows the comment and, as its own row, who rejected it by display name with their profile card. - A resubmit step neither shows nor requires specific users or teams. - The port picker's quick filters count options with the same filter as its list, so no column is offered. - Task title memos depend on the task, whose payload names a revision.
🚦 Removed from the merge queue —
|
…f the data product An output port must be one of the data product's own assets, in its domain; the test now adds it as an asset first, through a helper the both-kinds test shares.
Code Review ✅ Approved 1 closed / 1 findings🔴 High risk · Changing approval enforcement for data-product port relations could allow unapproved ports to publish if staged relation handling misapplies decisions. Holds data product port add/remove changes for approval under Enforce workflows, keeps approvals off the requester under assignAdmins, excludes table columns from the port picker, shows the Is Not Set operator on lifecycle status rules, and adds a Revise and resubmit task after rejected lifecycle approvals. Resolved the missing docs/decisions record for the port approval contract and gating rule. No open issues found. ✅ 1 closed✅ Quality: Port approval contract and gating rule are not recorded in docs/decisions
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|
🚦 Removed from the merge queue —
|
…show why a port is rejected (#36729) (#36984) * fix(data-products): keep port pickers to assets that can be ports and show why a port is rejected - Output port picker hides the data product's input ports, input port picker hides its output ports (ES `ids` exclusion; `id` is text-mapped). - Asset selection shows the per-asset reasons of an all-failed bulk add (400 BulkOperationResult) instead of the generic "Error while adding assets!" toast. - Clearer backend message: "Asset 'X' is already an input port of this data product; an asset cannot be both an input and an output port". * fix(data-products): keep each port picker's exclusions separate A late port fetch for one picker could overwrite the other picker's exclusion list when both Add Port buttons were clicked before the first fetch returned. * chore(ui): organize imports in InputOutputPortsTab test 2.0 backport notes: - Includes the column exclusion (PORT_ASSETS_FILTER) from #35740, which 2.0 lacks. - Adds ids to QueryFieldInterface, as on main, so the ids exclusion type-checks. - Drops the held-port-change test edit (WorkflowDefinitionResourceIT); 2.0 has no port approvals. - InputOutputPortsTab test keeps only the port picker suite. (cherry picked from commit 97af5ab)
…) (#38829) Backport of #38708, ported by hand: 2.0 has no "wait" empty-assignee strategy and gave the requester back under every strategy, so the assignAdmins fallback never ran for an event-driven approval. The requester is now never an assignee of an approval their own edit started. An emptied list goes to the node's empty-assignee strategy: none approves automatically, assignAdmins assigns the other admins and, as on main since #35740, keeps the task open when the requester is the only admin instead of approving it.



Describe your changes:
Four fixes and one addition for data products, approvals and lifecycle workflows, found together while testing data product lifecycles and Enforce change approval.
inputPorts/outputPortswere already data product trigger fields, so a workflow could name them and silently do nothing.assignAdmins. For a workflow running after an edit is published, when the only possible approver was the requester, the requester was put back on the task whenever the strategy was notwait. WithassignAdminsthat skipped the admin fallback, so the requester could approve their own change (seen on a lifecycle approval: no reviewers, owned by the editor).dataAssetindex, which includes columns, so a column could be picked and the server then refused it (... of type 'tableColumn' cannot be added as a port).entityStatus == null), which the rule builder reads as Is Not Set. The Status field offered only Is / Is Not, so the canvas showed the Operator placeholder beside "No value needed" instead of the rule.docs/decisions/2026-10-21-a-rejected-lifecycle-approval-asks-for-a-revision-and-the-next-edit-resubmits-it.md.Type of change:
High-level design:
1. Port approval
inputPortsandoutputPorts(entity references, identity = id).ApprovalGate.admitRelationsadmits such an edit through the same staging as a PATCH.EntityRepositorygains staged-relation hooks (getStagedRelationFields,addStagedRelations,validateStagedRelations,applyStagedRelations), empty by default;DataProductRepositoryimplements them for ports.Pending approval: change request <id>, 202 throughApprovalGate.bulkResponse) or write them as before. Bots write through; impersonated requests are judged as the person (ChangeActor), like asset edits.ChangeApplyService.currentTreeadds the ports wherever the entity JSON is judged (applicability, moved, apply, rebase). Publishing splits ops: field ops through the JSON Patch path as before, port ops throughapplyStagedRelations, in the same transaction. A held field change and a held port change from the same person form one request.2. Requester re-add —
SetApprovalAssigneesImplkeeps the requester only under thenonestrategy (the case with no fallback);assignAdminsroutes to the other admins,waitleaves the task unassigned. Change request reviews and workflow-managed tasks are unchanged.3. Port picker —
useAssetSelectionStatecombines amust_not entityType = tableColumnclause into the query filter for input/output port pickers only.4. Status rule operator —
JSONLogicSearchClassBaseoffersis_null/is_not_null(Is Not Set / Is Set) on the Status field alongside Is / Is Not; the exported JSON Logic is unchanged.QueryBuilderRuleRowgives the Operator column the same minimum width the Field column already has, so the label reads in full in narrow side panels.5. Revise and resubmit
TaskWorkflowHandler: on a rejection, sets two global workflow variables before completing the Flowable task,rejectionCommentandrejectedBy. The task page's Reject asks for no comment, so a rejection without its own comment takes the reviewer's latest comment on the task thread.collectMetadataTaskgainsconfig.revision(request|resubmit).request, on the approval's reject edge, opens (or reopens, one per asset, workflow and stage) aMetadataCompletiontask titled Revise and resubmit for the stage's assignees (owners; admins when there are none), withpayload.revision {comment, requestedBy}and no transitions.resubmit, placed before the approval, completes it as Resubmitted for approval when the next edit reaches the approval again. It still closes like any Metadata Completion task when the asset leaves the stage.Tests:
Use cases covered
add inputPortsop; the reviewer approves and the port is added.assignAdmins: the approval goes to the admins, never the editor.Unit tests
org.openmetadata.service.governance.approval.*Test— 156 run, 0 failures.useAssetSelectionState.test.ts— 3 new tests; theAssetsSelectionModalfolder: 5 suites, 100 passed.MetadataCollectionServiceTest(keepsOneRevisionTaskPerAssetWorkflowAndStage) andTaskWorkflowHandlerTest(aRejectionWithoutItsOwnCommentUsesTheReviewersLatestTaskComment): 30 run, 0 failures.InboxPage,Entity/Task,WorkflowBuilder/forms,ActivityFeed: 82 suites, 1075 passed, 0 failed. New: revision task offers no resolve actions (taskResolve.utils), no Action Required on the task tab (TaskTabNew); both fail without the change. Revision rendering inMetadataCompletionTask,taskDetail.utils,CollectMetadataForm.yarn ui-checkstyle:changed: 0 errors.JSONLogicSearchClassBase.test.ts+ theQueryBuilderCanvasfolder — 123 passed, 0 failed, on this branch and on currentmain. The two new tests (lets a status rule ask whether a stage is set,should keep the operator column wide enough to read its label) fail without the change.yarn ui-checkstyle:changedclean.Integration tests
WorkflowDefinitionResourceIT:test_dataProductPortAddIsHeldUntilApproved,test_dataProductPortRemovalIsHeldAndARejectionKeepsThePort,test_botPortEditIsNotHeld,test_heldDescriptionAndPortChangesApplyTogether,test_dataProductPortCannotBecomeBothKindsThroughOneRequest,test_heldPortToAnAssetDeletedBeforeApprovalIsNotAdded,test_approvalWithOnlyTheRequesterToAskGoesToAdmins.test_approvalWithOnlyTheRequesterToAskGoesToAdminsfails against the previousSetApprovalAssigneesImpl(Expected an open approval task assigned to <admin>) and passes with this change.WorkflowDefinitionResourceITtests above plustest_changeRequestWithNoOtherReviewerGoesToAdminsWhenTheNodeAsks— 8 run, 0 failures;ChangeRequestAdmissionIT,ChangeRequestApplyIT,ChangeRequestImportAndBulkIT— passing;DataProductResourceIT+WorkflowTaskAssigneesIT— 281 run, 0 failures, 28 skipped by the suite itself.test_rejectedApprovalAsksForARevisionAndTheNextEditResubmitsIt(start → resubmit → approve; reject → revise). At2f75b1f8da, the 9WorkflowDefinitionResourceITtests matching*eject*(this one and every other rejection test in the class) — 9 run, 0 failures. Rejection regression after theTaskWorkflowHandlerchange:ChangeRequestDecisionIT,TagRecognizerFeedbackIT,TaskResourceIT— 305 run, 0 failures, 31 skipped by the suites themselves.test_heldDescriptionAndPortChangesApplyTogethertimed out once in five local runs waiting for the review task of the superseding revision (no open task at all), and passed the other four, alone and with the class. It exercises the existing revision-supersede delivery; flagging it in case it shows in CI.Manual testing
On a local Collate server built from this branch.
Held port: the approver's task shows the held port, the data product still shows 0 ports and 1 pending change; approving adds the port.
Port picker: a table
loyalty_memberswith columnsmember_idandloyalty_points. A plaindataAssetsearch forloyaltyreturns both columns; the Add Input Ports picker lists the database, schema, table and data products, and no columns.Status rule: Govern > Workflows > a data product lifecycle > Canvas > Check starting stage. Both rules show their operator; the same on the glossary lifecycle.
Revise and resubmit: a metric lifecycle whose In Review approval asks the reviewers, on rejection Revise and resubmit. The reviewer rejects; the owner's task shows the comment and who asked, with no action buttons, on the asset's Tasks tab and on the task page.
The compiled nodes in the canvas: Rejected: ask to revise in In Review on the approval's reject edge, and the step that closes the request before the approval.
Checklist:
Summary by Gitar
This will update automatically on new commits.
The new helper must meet the repository's
finalparameter requirement before merging.Findings
Summary
The PR holds data product port edits for approval and adds revision tasks after rejected lifecycle approvals. It also fixes requester assignment, port choices, and status rule labels.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD Edit[Port edit] --> Gate{Approval required?} Gate -->|Yes| Request[Pending change request] Gate -->|No| Write[Write ports] Request -->|Approved| Write Request -->|Rejected| Keep[Keep published ports] Approval[Lifecycle approval] -->|Rejected| Revision[Revise and resubmit task] Revision --> NextEdit[Next asset edit] NextEdit --> Close[Complete revision task] Close --> ApprovalReviews (11) · Last reviewed commit: "test(governance): make the output port o..." · Reviewed by Greptile